package com.museum.controller.impl;

import com.alibaba.fastjson.JSONObject;
import com.museum.base.BaseApiService;
import com.museum.base.BaseResponse;
import com.museum.controller.api.PermissionAPI;
import com.museum.service.impl.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @Description:
 * @ClassName museum
 * @Author: 王瑞文
 * @Date: 2020/12/3 10:05
 */
@RestController
@RequestMapping("permission")
public class PermissionController extends BaseApiService<JSONObject> implements PermissionAPI {
    @Autowired
    private PermissionService permissionService;

    @Override
    public BaseResponse<JSONObject> getAllPermission(HttpServletRequest request) {
        return permissionService.getAllPermission(request);
    }
    @Override
    public BaseResponse<JSONObject> closePermission(HttpServletRequest request, Integer permissionId) {
        return permissionService.closePermission(request,permissionId);
    }

    @Override
    public BaseResponse<JSONObject> openPermission(HttpServletRequest request, Integer permissionId) {

        return permissionService.openPermission(request,permissionId);
    }


}
